/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package metro.jme.lottery.graphics.screens;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;
import metro.jme.lottery.main.LotteryMIDlet;

/**
 * Class displaying the license of the application
 * @author pierre
 */
public class License extends TextBox implements CommandListener {

	private Command m_backCmd;
	public final static String CONTENT = "DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n"
			+ "Version 2, December 2004\n"
			+ "Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>\n"
			+ "Everyone is permitted to copy and distribute verbatim or modified"
			+ "copies of this license document, and changing it is allowed as long"
			+ "as the name is changed.\n"
			+ "DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE"
			+ "TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n"
			+ "0. You just DO WHAT THE FUCK YOU WANT TO.";

	private LotteryMIDlet m_lotteryMIDlet;
	private Displayable previousScreen;
	
	public License(LotteryMIDlet m, Displayable d) {
		super("License", CONTENT, 65536, TextField.UNEDITABLE);

		m_lotteryMIDlet = m;
		previousScreen = d;
		
		m_backCmd = new Command("Back", Command.BACK, 1);
		this.addCommand(m_backCmd);


	}

	public void commandAction(Command cmnd, Displayable dsplbl) {
		if (cmnd == m_backCmd) {
			m_lotteryMIDlet.displayNewScreen(previousScreen);
		}
	}
}
